Ternary 三元運算子


Posted by Rich on 2021-04-22

console.log(10 > 5 ? 'bigger' : 'smaller')
output:bigger

condition ? true : false
條件 ? true就執行 : false就執行


#note







Related Posts

Find the prime number

Find the prime number

[IIS] 拒絕存取路徑 & 開啟資料夾權限

[IIS] 拒絕存取路徑 & 開啟資料夾權限

Vue.js 學習旅程Mile 14 – Form Input Bindings 表單綁定篇:v-model

Vue.js 學習旅程Mile 14 – Form Input Bindings 表單綁定篇:v-model


Comments